﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using TenpointSystem.Common.Db;
using TenpointSystem.Domian;
using TenpointSystem.Dal.UserTableMapper;

namespace TenpointSystem.Dal
{
    class UserTable
    {
        public User searchUserInfo(string loginName, string password)
        {
            MySqlParam sqlparam = new MySqlParam();
            sqlparam.sql = " select * from user where login_name=@loginName and password=@password ";
            sqlparam.sqlparam = new MySql.Data.MySqlClient.MySqlParameter[]
            {
                new MySql.Data.MySqlClient.MySqlParameter("@loginName", loginName),
                new MySql.Data.MySqlClient.MySqlParameter("@password", password)
            };
            return MySqlHelper.selectOne<User>(sqlparam, new SearchUserVaildMapper());
        }
    }
}
